package views.crm;

import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import javax.swing.SpringLayout;
import javax.swing.SwingConstants;

import controller.CustomerReportController;

import uiframework.UIFrameWork;

public class CrmView extends JPanel implements MouseListener{
	private JButton btnCustomerReport;
	private JToolBar toolBar;
	private SpringLayout springLayout;
	public CrmView() {
		springLayout = new SpringLayout();
		setLayout(springLayout);
		setSize(1050,550);
		
		toolBar=UIFrameWork.addToolBar(this, springLayout);
		String[] menunames={"Custmer Report"};
		JLabel[] labels=UIFrameWork.setLeftMenu(menunames,toolBar, new Dimension(180, 40));
		Font f=new Font("MS Reference Sans Serif", Font.PLAIN, 13);
		UIFrameWork.styleLeftMenu(labels, f, null, null);
		
		}

	@Override
	public void mouseClicked(MouseEvent e) {
		// TODO Auto-generated method stub
		if(e.getSource() instanceof JLabel)
		{
			JLabel label=(JLabel) e.getSource();
			String labelTitle=label.getText();
		
			if(labelTitle.equals("Custmer Report"))
			{
				CustomerReportView view=new CustomerReportView();
				UIFrameWork.setReportComponent(springLayout,view,this,2);
				CustomerReportController custcntrl=new CustomerReportController(view, null);
			}
		}
		
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}








	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}








	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	
}
